const express = require('express');
const router = express.Router();

const ctrl = require('../controller/articleCtrl');

// -----------------------------------------------渲染页面----------------------------------------------

router.get('/article/add',ctrl.showAdd);

router.get('/article/info/:id',ctrl.showInfo);

router.get('/article/edit/:id',ctrl.showEdit);

// -----------------------------------------------数据库 页面交互----------------------------------------------

router.post('/article/add',ctrl.addArticle);

router.post('/article/edit',ctrl.editArticle);

module.exports = router;